import React, {useRef, useState} from 'react';

function App(){

    const [num,setnum]=useState(0)
    //useState记忆函数,记住状态

    var mycount=useRef(0)
    return (
        <div>
            <button onClick={()=>{
                setnum(num+1)
                mycount.current++
            }}> click</button>
            {num}-{mycount.current}
        </div>
    );
};

export default App;
